<script setup>
import {ref} from 'vue'
import InsertTask from "./InsertTask.vue";
// 数据
const data = ref({
  taskId:0,
  content:''
})
// 是否添加任务
const isInsertTask = ref(false)
// 关闭弹窗
const handleCloseInsertTask = () => {
  isInsertTask.value = false
}
// 显示弹窗
const handleShowInsertTask = () => {
  isInsertTask.value = true
}



</script>

<template>
  <div class="common-layout">
    <el-container>
      <el-header style="background: #3a4357;height: 10vh">
        <div style="display: flex; align-items: center; height: 100%;">
          <!--        居中-->
          <span style="color: white;margin-left: 50%">新建主题讨论</span>
          <!--        靠右-->
          <el-button type="primary" style="margin-left: auto;margin-right: 10px" @click="handleShowInsertTask">保存并发布</el-button>
        </div>
      </el-header>
      <el-main style="height: 90vh">
        <el-form
            :label-position="'top'"
            label-width="auto"
            style="margin-left: 200px"
        >
          <el-form-item label="讨论主题" size="large">
            <el-input
                v-model="data.content"
                style="width: 1000px;"
                :autosize="{ minRows: 20}"
                :rows="100"
                type="textarea"
                placeholder="请输入讨论主题"
            />
          </el-form-item>
        </el-form>
        <InsertTask v-model="isInsertTask" @close="handleCloseInsertTask" :type="2" :data="data"></InsertTask>
      </el-main>
    </el-container>
  </div>
</template>

<style scoped lang="less">

</style>